package com.sunsys.mapreduce.distributedcache.example1;

import java.io.IOException;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

public class DistrbuteCacheMapper extends Mapper<LongWritable, Text, NullWritable, Text> {

	public DistrbuteCacheMapper() {
	}
	
	@Override
	protected void setup(Mapper<LongWritable, Text, NullWritable, Text>.Context context) throws IOException, InterruptedException {

		System.out.println("class path:"+System.getProperty("java.class.path"));
		try {
			Class  c = Class.forName("com.sunsys.module.util.formatter.ipml.DelimitedFormatter");
			if(c !=null ) {
				System.out.println("Class is loaded into memory"+c.getName());
			}
		}catch(ClassNotFoundException e1) {
			e1.printStackTrace();
		}
	}
	
	@Override
	protected void map(LongWritable key, Text value, Mapper<LongWritable, Text, NullWritable, Text>.Context context)
			throws IOException, InterruptedException {
		System.out.println("record :"+value.toString());
	}
	
}
